﻿@model SuCasa.Models.RoleCallViewModel
@{
    ViewBag.Title = "RoleCall";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="page-header">
    <h2>RoleCall</h2>


    @using (Ajax.BeginForm("UpdateAttendance", "Course", new AjaxOptions { UpdateTargetId = "attendanceDiv", OnSuccess = "OnSuccess", OnFailure = "OnFailure" }, new { @class = "form-horizontal" }))
             {
          <label>Attendance</label>
            @Html.CheckBoxFor(Model => Model.Attended)

         <label>HomeWork</label>
        @Html.CheckBoxFor(Model => Model.HomeWork)
            
             }
    

        


    
    
    <div id="attendanceDiv">
        hello world
    </div>
    
    <div id="homeworkDiv">
        hello world homework
    </div>

</div>
<script type="text/javascript">
    function OnSuccess() {
        alert('Success');
    }
    function OnFailure(ajaxContext) {
        var response = ajaxContext.get_response();
        var statusCode = response.get_statusCode();
        alert('Failure');
        $('#targetDiv').empty();
    }
</script>


@*<table class="table-striped">
        <tr>
            <th>Session Title</th>
            <th>Date</th>
            
        </tr>
        <tr>
            <td></td>
        </tr>
    </table>*@
